
#
# play list
#
class TuneList
  tunes: null
  tune_on_playing: null

  #
  # constructor
  #
  constructor:()->
    @tunes = []
    
  #
  # add
  #
  add_tune:(tune)->
    @tunes.push(tune)

  #
  # count
  #
  count:->
    @tunes.length

  #
  # search and set as 'new_tune' in tunes[]
  #
  search_and_replace:(new_tune)->
    for tune in @tunes
      if new_tune.is_same_name_and_owner(tune)
        tune.set(new_tune)
        break
    